<template>
  <div>
    <!-- 标题 -->
    <van-cell title="搜索历史">
      <van-icon @click="isDel = true" v-if="isDel" name="delete-o"></van-icon>
      <template>
        <span @click="$emit('clearHistory')">全部删除</span>
        <span style="margin-left:10px:;">完成</span>
      </template>
    </van-cell>
    <!-- 历史记录 -->
    <van-cell :title="item" v-for="item in history" :key="item">
      <van-icon v-if="isDel" name="close" />
    </van-cell>
  </div>
</template>

<script>
export default {
  data () {
    return {
      isDel: false
    }
  },
  props: {
    history: {
      type: Array,
      required: true
    }
  },
  methods: {},
  computed: {},
  watch: {},
  filters: {},
  components: {},
  created () { },
  mounted () { }
}
</script>

<style scoped lang='less'>
</style>
